/*
* 常用功能button
* */
'use strict';
import React,{Component} from 'react';
import FIcon from 'react-native-vector-icons';
import Util from '../common/util'
import SignIn from './userIntegral/signIn';//签到
import MyVoucher from './userVoucher/myVoucher';//我的券码
import MyCollection from './userCollection';//我的收藏
import MyHistory from './userHistory';//历史足迹
import AddressAdmin from '../address/addressAdmin';//地址管理
import MyGroup from './userGroup/myGroup';
import {
    View,
    Text,
    Image,
    TouchableOpacity,
    Animated,
    StyleSheet
} from 'react-native';
export default class commonFunc extends Component{
    // 构造
      constructor(props) {
        super(props);
        // 初始状态
        this.state = {

        };
      }

      linkJump(jump){
          this.props.navigator.push({
              component:jump,
              passProps:{
                  user_id:this.props.user_id
              }
          })
      }

      render(){
          return(
              <View style={styles.common_view}>
                  <View style={styles.common_header}>
                      <Image
                          source={require('../imgs/center_icon1.png')}
                          style={{width:20,height:20,marginRight:5}}
                          resizeMode={'cover'}
                      />
                      <Text style={{fontSize:14,color:"#333"}}>常用功能</Text>
                  </View>
                  <View style={styles.common_list_view}>
                      {/*<TouchableOpacity onPress={()=>this.linkJump(SignIn)} style={styles.common_item}>*/}
                          {/*<Image*/}
                              {/*source={require('../imgs/sign.png')}*/}
                              {/*resizeMode={'cover'}*/}
                              {/*style={{width:40,height:40,marginBottom:5}}*/}
                          {/*/>*/}
                          {/*<Text style={{fontSize:12,color:"#333"}}>签到</Text>*/}
                      {/*</TouchableOpacity>*/}
                      <TouchableOpacity onPress={()=>this.linkJump(MyVoucher)} style={styles.common_item}>
                          <Image
                              source={require('../imgs/serverjuan.png')}
                              resizeMode={'cover'}
                              style={{width:40,height:40,marginBottom:5}}
                          />
                          <Text style={{fontSize:12,color:"#333"}}>礼品券码</Text>
                      </TouchableOpacity>
                      <TouchableOpacity onPress={()=>this.linkJump(MyCollection)} style={styles.common_item}>
                          <Image
                              source={require('../imgs/center_icon10.png')}
                              resizeMode={'cover'}
                              style={{width:40,height:40,marginBottom:5}}
                          />
                          <Text style={{fontSize:12,color:"#333"}}>我的收藏</Text>
                      </TouchableOpacity>
                      <TouchableOpacity onPress={()=>this.linkJump(MyHistory)} style={styles.common_item}>
                          <Image
                              source={require('../imgs/center_icon7.png')}
                              resizeMode={'cover'}
                              style={{width:40,height:40,marginBottom:5}}
                          />
                          <Text style={{fontSize:12,color:"#333"}}>历史足迹</Text>
                      </TouchableOpacity>
                      <TouchableOpacity onPress={()=>this.linkJump(AddressAdmin)} style={styles.common_item}>
                          <Image
                              source={require('../imgs/center_icon4.png')}
                              resizeMode={'cover'}
                              style={{width:40,height:40,marginBottom:5}}
                          />
                          <Text style={{fontSize:12,color:"#333"}}>地址管理</Text>
                      </TouchableOpacity>
                  </View>
                  <View style={styles.common_list_view}>
                      <TouchableOpacity onPress={()=>this.linkJump(MyGroup)} style={styles.common_item}>
                          <Image
                              source={require('../imgs/center_icon17.png')}
                              resizeMode={'cover'}
                              style={{width:40,height:40,marginBottom:5}}
                          />
                          <Text style={{fontSize:12,color:"#333"}}>我的拼团</Text>
                      </TouchableOpacity>
                  </View>
              </View>
          )
      }
}
var styles = StyleSheet.create({
    common_view:{
        backgroundColor:"#fff",
        paddingHorizontal:10
    },
    common_header:{
        height:40,
        flexDirection:"row",
        alignItems:'center',
        borderBottomWidth:1,
        borderBottomColor:"#e0e0e0"
    },
    common_list_view:{
        flexDirection:'row',
        flexWrap:'wrap',
        paddingVertical:10
    },
    common_item:{
        width:(Util.size.width-20)/4,
        alignItems:'center',
        justifyContent:'center',
    }
})